<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta http-equiv="Content-Type">
	<meta charset="utf-8">
	<title>G4摇一摇</title>		
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<meta name="format-detection" content="telephone=no">
	<meta name="format-detection" content="email=no">        
    <link type="text/css" href="{$_C.hy_path}css/main-sign.css" rel="stylesheet" />
</head>
<body>
	<img src="{$_C.hy_path}images/bg.jpg" alt="">
	<div class="wrapper">
		<div class="title">
			<img src="{$_C.hy_path}images/title.png" alt="">
			<img src="{$_C.hy_path}images/logo.png" alt="" class="shake logo">
		</div>
		<div class="content rule">
			<img src="{$_C.hy_path}images/rule.png" alt="">
		</div>
		<div class="btn_wrapper rule">
			<a href="javascript:void(0)"><img src="{$_C.hy_path}images/hand-enter.png" alt=""></a>
		</div>
		<div class="content bus_circle">
			<img src="{$_C.hy_path}images/bus_circle.png" alt="">
			<h1 id="number">00</h1>
			<div class="bus">
				<img src="{$_C.hy_path}images/bus.png" alt="">
			</div>
			<div class="hand">
				<img src="{$_C.hy_path}images/hand02.png" alt="">
				<p>点签到，拿礼品</p>
			</div>
			<div class="cloud">
				<img src="{$_C.hy_path}images/cloud.png" alt="">
				<img src="{$_C.hy_path}images/cloud.png" alt="">
			</div>
		</div>
		<ul class="btn_wrapper">
			<li><a href="http://create.maka.im/k/BYWJDNXA"><img src="{$_C.hy_path}images/more.png" alt=""></a></li>
			<li><a id="persent" {if $persent.id}onclick="get_persent('{$persent.id}')"{/if}><img src="{$_C.hy_path}images/gift.png" alt=""><span></span></a></li>
			<li><a href="http://hd.faisco.cn/6833232/4/load.html?style=12"><img src="{$_C.hy_path}images/game.png" alt=""></a></li>
		</ul>
	</div>

	<div class="question-link">
		<img src="{$_C.hy_path}images/q-link.png" alt="" id="q_link">
	</div>
	<div class="modal">
		<img src="{$_C.hy_path}images/modal.png" alt="">
		<img src="{$_C.hy_path}images/q-return.png" alt="" id="q_return">
	</div>
	<div class="mask_zzc"></div>
    <div class="alert" id="alert2" style="padding:15px">
		
			<div id="msg" class="fs3"></div>
			<a href="javascript:void(0)" class="alert-btn fc1 fs3">确定</a>
			
	</div>
	<script src="{$_C.hy_path}js/zepto.min.js"></script>
	<script src="{$_C.hy_path}js/main-sign.js"></script>
	<script>
		var num =parseInt("{$record.totalnum}");
		var isSign =parseInt("{$isSign}");
		var isPersent =parseInt("{$isPersent}");
		var handTips;
		$(document).ready(function(){
			if (num<=9) {
				$("#number").text("0"+num);
			}else{
				$("#number").text(num);
			}
			if(isSign==0){
				$('.hand').hide();
			}else{
				handTips = setInterval(function(){
					$('.hand p').toggleClass('show');
				},1500);
			}
			if(isPersent==1){
				$('ul.btn_wrapper li span').addClass('show');
			}
			$('a.alert-btn').click(function (e) {
		    		$('div.alert').hide();
		    		$('.mask_zzc').hide();
		    	});
		})
		function showMsg(msg){
	    		$("#msg").text(msg);
				$('#alert2').show();
				$('.mask_zzc').show();
	    	}
		$('h1').click(function(){
			var url = "/ws/index.php?g=mobile&m=sign&a=sign";
			$.post(url,"",function(data){
				if(data.error==1){
					showMsg(data.content);
					clearInterval(handTips);
					var num = parseInt($("#number").text());
					num++;
					if (num<=9) {
						$("#number").text("0"+num);
					}else{
						$("#number").text(num);
					}
					$('.hand').hide();
					if(data.show==1){
						$('ul.btn_wrapper li span').addClass('show');
						$('#persent').attr("onclick","get_persent('"+data.id+"')");
					}
					if(data.isFirst){
						window.location.href="http://g4.airefp.com/index.php?g=Wap&m=Lotterygzx&a=index&token=rdypyq1433472856&id=49";
					}
				}else{
					showMsg(data.content);
				}
				},"json");
				
		})
		function get_persent(id){
			var url = "/ws/index.php?g=mobile&m=sign&a=persent";
			var data = {
				'pid':id
			}
			$.post(url,data,function(res){
				if(res.error==1){
					window.location.href=res.url;
				}else{
					showMsg(res.content);
				}
				},"json");
		}
	</script>
<!--	<script type="text/javascript" src="http://zb.weixin.qq.com/nearbycgi/addcontact/BeaconAddContactJsBridge.js"></script>

<script type="text/javascript">

//			wx.config({
//				debug: false,
//				appId: '{$jsdk.appId}',
//				timestamp: {$jsdk.timestamp},
//				nonceStr: '{$jsdk.nonceStr}',
//				signature: '{$jsdk.signature}',
//				jsApiList: [
//					 'onMenuShareTimeline',
//		      		'onMenuShareAppMessage'
//				]
//			});
//			
//			wx.hideMenuItems({
//    	menuList: [
//			'menuItem:share:appMessage',
//			'menuItem:share:timeline',
//			'menuItem:share:qq'
//			] // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
//		});
//
//	
	BeaconAddContactJsBridge.ready(function(){
		//判断是否关注
		BeaconAddContactJsBridge.invoke('checkAddContactStatus',{} ,function(apiResult){
			if(apiResult.err_code == 0){
				var status = apiResult.data;
				if(status == 1){
					
				}else{
					
					//跳转到关注页
				  BeaconAddContactJsBridge.invoke('jumpAddContact');
				}
			}else{
				alert(apiResult.err_msg)
			}
		});
 	});
</script>-->
</body>
</html>
